package com.dm.wallpaper.library.helpers;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class ListHelper {
    public ListHelper() {
    }

    public static <T> Collection<T> intersect(Collection<? extends T> a, Collection<? extends T> b) {
        Collection<T> result = new ArrayList();
        Iterator var3 = a.iterator();

        while(var3.hasNext()) {
            T t = (T) var3.next();
            if (b.remove(t)) {
                result.add(t);
            }
        }

        return result;
    }

    public static <T> Collection<T> difference(Collection<? extends T> a, Collection<? extends T> b) {
        Collection<T> result = new ArrayList();
        result.addAll(b);
        Iterator var3 = a.iterator();

        while(var3.hasNext()) {
            T t = (T) var3.next();
            result.remove(t);
        }

        return result;
    }
}
